]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
st: Add StPolicyType enum
authorCarlos Garnacho <carlosg@gnome.org>
Tue, 27 Nov 2018 12:45:36 +0000 (13:45 +0100)
committerCarlos Garnacho <carlosg@gnome.org>
Wed, 30 Jan 2019 21:50:01 +0000 (22:50 +0100)
In order to replace GTK+'s GtkPolicyType. It's bit-compatible with it, too.
All callers have been updated to use it.

This is a purely accessory change in terms of X11 Display usage cleanup,
but helps see better what is left.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/317

14 files changed:
js/gdm/loginDialog.js
js/ui/appDisplay.js
js/ui/calendar.js
js/ui/components/telepathyClient.js
js/ui/dateMenu.js
js/ui/endSessionDialog.js
js/ui/popupMenu.js
js/ui/screenShield.js
js/ui/search.js
js/ui/shellMountOperation.js
js/ui/status/network.js
js/ui/switcherPopup.js
src/st/st-scroll-view.c
src/st/st-scroll-view.h

index a22f55e595f3a75bd49c343802a43e2caf9aca77..db4d2069ab1af1042ac9b69e4485701bc24dbede 100644 (file)
@@ -161,8 +161,8 @@ Signals.addSignalMethods(UserListItem.prototype);
 var UserList = class {
     constructor() {
         this.actor = new St.ScrollView({ style_class: 'login-dialog-user-list-view'});
-        this.actor.set_policy(Gtk.PolicyType.NEVER,
-                              Gtk.PolicyType.AUTOMATIC);
+        this.actor.set_policy(St.PolicyType.NEVER,
+                              St.PolicyType.AUTOMATIC);
 
         this._box = new St.BoxLayout({ vertical: true,
                                        style_class: 'login-dialog-user-list',
@@ -473,8 +473,8 @@ var LoginDialog = GObject.registerClass({
 
         this._bannerView = new St.ScrollView({ style_class: 'login-dialog-banner-view',
                                                opacity: 0,
-                                               vscrollbar_policy: Gtk.PolicyType.AUTOMATIC,
-                                               hscrollbar_policy: Gtk.PolicyType.NEVER });
+                                               vscrollbar_policy: St.PolicyType.AUTOMATIC,
+                                               hscrollbar_policy: St.PolicyType.NEVER });
         this.add_child(this._bannerView);
 
         let bannerBox = new St.BoxLayout({ vertical: true });
index b8865cf2ccbc671b61fdee41b8a5d9ec31fb63ad..d888ec305ba3f943b1759f41b98e687cb8608cb1 100644 (file)
@@ -370,8 +370,8 @@ var AllView = class AllView extends BaseAppView {
                                      x_expand:true, y_expand:true });
         this.actor.add_actor(this._scrollView);
 
-        this._scrollView.set_policy(Gtk.PolicyType.NEVER,
-                                    Gtk.PolicyType.EXTERNAL);
+        this._scrollView.set_policy(St.PolicyType.NEVER,
+                                    St.PolicyType.EXTERNAL);
         this._adjustment = this._scrollView.vscroll.adjustment;
 
         this._pageIndicators = new PageIndicators();
@@ -1124,7 +1124,7 @@ var FolderView = class FolderView extends BaseAppView {
         this._grid.x_expand = true;
 
         this.actor = new St.ScrollView({ overlay_scrollbars: true });
-        this.actor.set_policy(Gtk.PolicyType.NEVER, Gtk.PolicyType.AUTOMATIC);
+        this.actor.set_policy(St.PolicyType.NEVER, St.PolicyType.AUTOMATIC);
         let scrollableContainer = new St.BoxLayout({ vertical: true, reactive: true });
         scrollableContainer.add_actor(this._grid);
         this.actor.add_actor(scrollableContainer);
index bbe44d022e66d7289887bf71bb9f9cc4e930d54e..32a99344c7b92b76b7bf4a0c7cc4a2dc1d72f07b 100644 (file)
@@ -3,7 +3,6 @@
 const Clutter = imports.gi.Clutter;
 const Gio = imports.gi.Gio;
 const GLib = imports.gi.GLib;
-const Gtk = imports.gi.Gtk;
 const St = imports.gi.St;
 const Signals = imports.signals;
 const Shell = imports.gi.Shell;
@@ -1083,7 +1082,7 @@ var CalendarMessageList = class CalendarMessageList {
                                                overlay_scrollbars: true,
                                                x_expand: true, y_expand: true,
                                                x_fill: true, y_fill: true });
-        this._scrollView.set_policy(Gtk.PolicyType.NEVER, Gtk.PolicyType.AUTOMATIC);
+        this._scrollView.set_policy(St.PolicyType.NEVER, St.PolicyType.AUTOMATIC);
         box.add_actor(this._scrollView);
 
         this._clearButton = new St.Button({ style_class: 'message-list-clear-button button',
index 41b4985f466be06c84778315126f6b35e6349c2b..86e40b4e7873ac7190e18180113309048d19f861 100644 (file)
@@ -4,7 +4,6 @@ const Clutter = imports.gi.Clutter;
 const Gio = imports.gi.Gio;
 const GLib = imports.gi.GLib;
 const GObject = imports.gi.GObject;
-const Gtk = imports.gi.Gtk;
 const Lang = imports.lang;
 const Mainloop = imports.mainloop;
 const Signals = imports.signals;
@@ -821,8 +820,8 @@ var ChatNotificationBanner = class extends MessageTray.NotificationBanner {
         });
 
         this._scrollArea = new St.ScrollView({ style_class: 'chat-scrollview vfade',
-                                               vscrollbar_policy: Gtk.PolicyType.AUTOMATIC,
-                                               hscrollbar_policy: Gtk.PolicyType.NEVER,
+                                               vscrollbar_policy: St.PolicyType.AUTOMATIC,
+                                               hscrollbar_policy: St.PolicyType.NEVER,
                                                visible: this.expanded });
         this._contentArea = new St.BoxLayout({ style_class: 'chat-body',
                                                vertical: true });
index b2e2f0cd8ad12c39182245417d2e1065c5bc4d43..5d693896057fab233529532ca771cf3f47af1299 100644 (file)
@@ -4,7 +4,6 @@ const GLib = imports.gi.GLib;
 const Gio = imports.gi.Gio;
 const GnomeDesktop = imports.gi.GnomeDesktop;
 const GObject = imports.gi.GObject;
-const Gtk = imports.gi.Gtk;
 const GWeather = imports.gi.GWeather;
 const Mainloop = imports.mainloop;
 const Pango = imports.gi.Pango;
@@ -515,7 +514,7 @@ class DateMenuButton extends PanelMenu.Button {
         this._displaysSection = new St.ScrollView({ style_class: 'datemenu-displays-section vfade',
                                                     x_expand: true, x_fill: true,
                                                     overlay_scrollbars: true });
-        this._displaysSection.set_policy(Gtk.PolicyType.NEVER, Gtk.PolicyType.AUTOMATIC);
+        this._displaysSection.set_policy(St.PolicyType.NEVER, St.PolicyType.AUTOMATIC);
         vbox.add_actor(this._displaysSection);
 
         let displaysBox = new St.BoxLayout({ vertical: true,
index 7c3a022569f2e7fb9c45751fa30d28ac1eea6cba..1d6efc5ecc31858bccc5667ca9c196185dbd5bb3 100644 (file)
@@ -22,7 +22,6 @@ const AccountsService = imports.gi.AccountsService;
 const Clutter = imports.gi.Clutter;
 const Gio = imports.gi.Gio;
 const GLib = imports.gi.GLib;
-const Gtk = imports.gi.Gtk;
 const Pango = imports.gi.Pango;
 const Polkit = imports.gi.Polkit;
 const St = imports.gi.St;
@@ -320,7 +319,7 @@ var EndSessionDialog = class EndSessionDialog extends ModalDialog.ModalDialog {
         messageLayout.add(this._batteryWarning);
 
         this._scrollView = new St.ScrollView({ style_class: 'end-session-dialog-list' });
-        this._scrollView.set_policy(Gtk.PolicyType.NEVER, Gtk.PolicyType.AUTOMATIC);
+        this._scrollView.set_policy(St.PolicyType.NEVER, St.PolicyType.AUTOMATIC);
         this.contentLayout.add(this._scrollView,
                                { x_fill: true,
                                  y_fill: true });
index 02ab885d4b1877aba86156ff64d93ec216294a93..81508bac30267aa791c22e1912aa0e74f4e6f02f 100644 (file)
@@ -914,8 +914,8 @@ var PopupSubMenu = class extends PopupMenuBase {
         // with long content, we make it scrollable - the scrollbar will only take
         // effect if a CSS max-height is set on the top menu.
         this.actor = new St.ScrollView({ style_class: 'popup-sub-menu',
-                                         hscrollbar_policy: Gtk.PolicyType.NEVER,
-                                         vscrollbar_policy: Gtk.PolicyType.NEVER });
+                                         hscrollbar_policy: St.PolicyType.NEVER,
+                                         vscrollbar_policy: St.PolicyType.NEVER });
 
         this.actor.add_actor(this.box);
         this.actor._delegate = this;
@@ -957,7 +957,7 @@ var PopupSubMenu = class extends PopupMenuBase {
         // when we *don't* need it, so turn off the scrollbar when that's true.
         // Dynamic changes in whether we need it aren't handled properly.
         this.actor.vscrollbar_policy =
-            needsScrollbar ? Gtk.PolicyType.AUTOMATIC : Gtk.PolicyType.NEVER;
+            needsScrollbar ? St.PolicyType.AUTOMATIC : St.PolicyType.NEVER;
 
         if (needsScrollbar)
             this.actor.add_style_pseudo_class('scrolled');
index 2f18390f35ace4c52ec8e2b8d2edaf22f2d384d6..31c0bbd5373cd928a35273643e7da93493de3820 100644 (file)
@@ -101,7 +101,7 @@ var NotificationsBox = class {
                                         style_class: 'screen-shield-notifications-container' });
 
         this._scrollView = new St.ScrollView({ x_fill: false, x_align: St.Align.START,
-                                               hscrollbar_policy: Gtk.PolicyType.NEVER });
+                                               hscrollbar_policy: St.PolicyType.NEVER });
         this._notificationBox = new St.BoxLayout({ vertical: true,
                                                    style_class: 'screen-shield-notifications-container' });
         this._scrollView.add_actor(this._notificationBox);
@@ -258,7 +258,7 @@ var NotificationsBox = class {
             // block scrollbars while animating, if they're not needed now
             let boxHeight = this._notificationBox.height;
             if (this._scrollView.height >= boxHeight)
-                this._scrollView.vscrollbar_policy = Gtk.PolicyType.NEVER;
+                this._scrollView.vscrollbar_policy = St.PolicyType.NEVER;
 
             let widget = obj.sourceBox;
             let [, natHeight] = widget.get_preferred_height(-1);
@@ -268,7 +268,7 @@ var NotificationsBox = class {
                                transition: 'easeOutQuad',
                                time: 0.25,
                                onComplete() {
-                                   this._scrollView.vscrollbar_policy = Gtk.PolicyType.AUTOMATIC;
+                                   this._scrollView.vscrollbar_policy = St.PolicyType.AUTOMATIC;
                                    widget.set_height(-1);
                                },
                                onCompleteScope: this
index df359ae703b1b8819d092fb97ccf74b5b69f7539..cf1e5d3254fdcd99be9567df795cf75b0d56371e 100644 (file)
@@ -402,7 +402,7 @@ var SearchResults = class {
                                                y_fill: false,
                                                overlay_scrollbars: true,
                                                style_class: 'search-display vfade' });
-        this._scrollView.set_policy(Gtk.PolicyType.NEVER, Gtk.PolicyType.AUTOMATIC);
+        this._scrollView.set_policy(St.PolicyType.NEVER, St.PolicyType.AUTOMATIC);
         this._scrollView.add_actor(scrollChild);
         let action = new Clutter.PanAction({ interpolate: true });
         action.connect('pan', this._onPan.bind(this));
index a49e75a8d3a6b5dc1d053e94de0bf02dedbc6779..4445ae12d064f97c987a01149e3df3c1702fb127 100644 (file)
@@ -4,7 +4,6 @@ const Clutter = imports.gi.Clutter;
 const Signals = imports.signals;
 const Gio = imports.gi.Gio;
 const GLib = imports.gi.GLib;
-const Gtk = imports.gi.Gtk;
 const Pango = imports.gi.Pango;
 const St = imports.gi.St;
 const Shell = imports.gi.Shell;
@@ -371,8 +370,8 @@ var ShellProcessesDialog = class extends ModalDialog.ModalDialog {
         this.contentLayout.add(this._content, { x_fill: true, y_fill: false });
 
         let scrollView = new St.ScrollView({ style_class: 'mount-dialog-app-list'});
-        scrollView.set_policy(Gtk.PolicyType.NEVER,
-                              Gtk.PolicyType.AUTOMATIC);
+        scrollView.set_policy(St.PolicyType.NEVER,
+                              St.PolicyType.AUTOMATIC);
         this.contentLayout.add(scrollView,
                                { x_fill: true,
                                  y_fill: true });
index a2388bd8b207729e2715601892d80fec3628a68c..46fc51c0964e1cd5f3231d97ad84d3090c88f22c 100644 (file)
@@ -3,7 +3,6 @@ const Clutter = imports.gi.Clutter;
 const GLib = imports.gi.GLib;
 const GObject = imports.gi.GObject;
 const Gio = imports.gi.Gio;
-const Gtk = imports.gi.Gtk;
 const Mainloop = imports.mainloop;
 const NM = imports.gi.NM;
 const Signals = imports.signals;
@@ -846,8 +845,8 @@ var NMWirelessDialog = class extends ModalDialog.ModalDialog {
         this._scrollView = new St.ScrollView({ style_class: 'nm-dialog-scroll-view' });
         this._scrollView.set_x_expand(true);
         this._scrollView.set_y_expand(true);
-        this._scrollView.set_policy(Gtk.PolicyType.NEVER,
-                                    Gtk.PolicyType.AUTOMATIC);
+        this._scrollView.set_policy(St.PolicyType.NEVER,
+                                    St.PolicyType.AUTOMATIC);
         this._scrollView.add_actor(this._itemBox);
         this._stack.add_child(this._scrollView);
 
index d941acf229372094bc891913fbac30180ab9b824..8e30e892f682bb9ad148353045ac686671eefe09 100644 (file)
@@ -3,7 +3,6 @@
 const Clutter = imports.gi.Clutter;
 const GLib = imports.gi.GLib;
 const GObject = imports.gi.GObject;
-const Gtk = imports.gi.Gtk;
 const Mainloop = imports.mainloop;
 const Meta = imports.gi.Meta;
 const Shell = imports.gi.Shell;
@@ -365,7 +364,7 @@ var SwitcherList = GObject.registerClass({
 
         this._scrollView = new St.ScrollView({ style_class: 'hfade',
                                                enable_mouse_scrolling: false });
-        this._scrollView.set_policy(Gtk.PolicyType.NEVER, Gtk.PolicyType.NEVER);
+        this._scrollView.set_policy(St.PolicyType.NEVER, St.PolicyType.NEVER);
 
         this._scrollView.add_actor(this._list);
         this.add_actor(this._scrollView);
index fc0db1c998e01678fe4e9de9c4d055667ece402f..1a83ad445a8ef33bbf536bfc1430c08206deef17 100644 (file)
@@ -58,6 +58,7 @@
  * detailed description of the considerations involved.
  */
 
+#include "st-enum-types.h"
 #include "st-scroll-view.h"
 #include "st-scroll-bar.h"
 #include "st-scrollable.h"
@@ -82,8 +83,8 @@ struct _StScrollViewPrivate
   StAdjustment *vadjustment;
   ClutterActor *vscroll;
 
-  GtkPolicyType hscrollbar_policy;
-  GtkPolicyType vscrollbar_policy;
+  StPolicyType hscrollbar_policy;
+  StPolicyType vscrollbar_policy;
 
   gfloat        row_size;
   gfloat        column_size;
@@ -372,12 +373,12 @@ st_scroll_view_get_preferred_width (ClutterActor *actor,
 
   switch (priv->hscrollbar_policy)
     {
-    case GTK_POLICY_NEVER:
+    case ST_POLICY_NEVER:
       min_width = child_min_width;
       break;
-    case GTK_POLICY_ALWAYS:
-    case GTK_POLICY_AUTOMATIC:
-    case GTK_POLICY_EXTERNAL:
+    case ST_POLICY_ALWAYS:
+    case ST_POLICY_AUTOMATIC:
+    case ST_POLICY_EXTERNAL:
       /* Should theoretically use the min width of the hscrollbar,
        * but that's not cleanly defined at the moment */
       min_width = 0;
@@ -389,14 +390,14 @@ st_scroll_view_get_preferred_width (ClutterActor *actor,
 
   switch (priv->vscrollbar_policy)
     {
-    case GTK_POLICY_NEVER:
-    case GTK_POLICY_EXTERNAL:
+    case ST_POLICY_NEVER:
+    case ST_POLICY_EXTERNAL:
       account_for_vscrollbar = FALSE;
       break;
-    case GTK_POLICY_ALWAYS:
+    case ST_POLICY_ALWAYS:
       account_for_vscrollbar = !priv->overlay_scrollbars;
       break;
-    case GTK_POLICY_AUTOMATIC:
+    case ST_POLICY_AUTOMATIC:
       /* For automatic scrollbars, we always request space for the vertical
        * scrollbar; we won't know whether we actually need one until our
        * height is assigned in allocate().
@@ -454,11 +455,11 @@ st_scroll_view_get_preferred_height (ClutterActor *actor,
 
   switch (priv->vscrollbar_policy)
     {
-    case GTK_POLICY_NEVER:
-    case GTK_POLICY_EXTERNAL:
+    case ST_POLICY_NEVER:
+    case ST_POLICY_EXTERNAL:
       break;
-    case GTK_POLICY_ALWAYS:
-    case GTK_POLICY_AUTOMATIC:
+    case ST_POLICY_ALWAYS:
+    case ST_POLICY_AUTOMATIC:
       /* We've requested space for the scrollbar, subtract it back out */
       for_width -= sb_width;
       break;
@@ -469,14 +470,14 @@ st_scroll_view_get_preferred_height (ClutterActor *actor,
 
   switch (priv->hscrollbar_policy)
     {
-    case GTK_POLICY_NEVER:
-    case GTK_POLICY_EXTERNAL:
+    case ST_POLICY_NEVER:
+    case ST_POLICY_EXTERNAL:
       account_for_hscrollbar = FALSE;
       break;
-    case GTK_POLICY_ALWAYS:
+    case ST_POLICY_ALWAYS:
       account_for_hscrollbar = !priv->overlay_scrollbars;
       break;
-    case GTK_POLICY_AUTOMATIC:
+    case ST_POLICY_AUTOMATIC:
       /* For automatic scrollbars, we always request space for the horizontal
        * scrollbar; we won't know whether we actually need one until our
        * width is assigned in allocate().
@@ -495,12 +496,12 @@ st_scroll_view_get_preferred_height (ClutterActor *actor,
 
   switch (priv->vscrollbar_policy)
     {
-    case GTK_POLICY_NEVER:
+    case ST_POLICY_NEVER:
       min_height = child_min_height;
       break;
-    case GTK_POLICY_ALWAYS:
-    case GTK_POLICY_AUTOMATIC:
-    case GTK_POLICY_EXTERNAL:
+    case ST_POLICY_ALWAYS:
+    case ST_POLICY_AUTOMATIC:
+    case ST_POLICY_EXTERNAL:
       /* Should theoretically use the min height of the vscrollbar,
        * but that's not cleanly defined at the moment */
       min_height = 0;
@@ -571,9 +572,9 @@ st_scroll_view_allocate (ClutterActor          *actor,
       clutter_actor_get_preferred_width (priv->child, -1,
                                          &child_min_width, NULL);
 
-      if (priv->vscrollbar_policy == GTK_POLICY_AUTOMATIC)
+      if (priv->vscrollbar_policy == ST_POLICY_AUTOMATIC)
         {
-          if (priv->hscrollbar_policy == GTK_POLICY_AUTOMATIC)
+          if (priv->hscrollbar_policy == ST_POLICY_AUTOMATIC)
             {
               /* Pass one, try without a vertical scrollbar */
               clutter_actor_get_preferred_height (priv->child, avail_width, &child_min_height, NULL);
@@ -591,7 +592,7 @@ st_scroll_view_allocate (ClutterActor          *actor,
             }
           else
             {
-              hscrollbar_visible = priv->hscrollbar_policy == GTK_POLICY_ALWAYS;
+              hscrollbar_visible = priv->hscrollbar_policy == ST_POLICY_ALWAYS;
 
               /* try without a vertical scrollbar */
               clutter_actor_get_preferred_height (priv->child, avail_width, &child_min_height, NULL);
@@ -600,20 +601,20 @@ st_scroll_view_allocate (ClutterActor          *actor,
         }
       else
         {
-          vscrollbar_visible = priv->vscrollbar_policy == GTK_POLICY_ALWAYS;
+          vscrollbar_visible = priv->vscrollbar_policy == ST_POLICY_ALWAYS;
 
-          if (priv->hscrollbar_policy == GTK_POLICY_AUTOMATIC)
+          if (priv->hscrollbar_policy == ST_POLICY_AUTOMATIC)
             hscrollbar_visible = child_min_width > avail_height - (vscrollbar_visible ? 0 : sb_width);
           else
-            hscrollbar_visible = priv->hscrollbar_policy == GTK_POLICY_ALWAYS;
+            hscrollbar_visible = priv->hscrollbar_policy == ST_POLICY_ALWAYS;
         }
     }
   else
     {
-      hscrollbar_visible = priv->hscrollbar_policy != GTK_POLICY_NEVER &&
-                           priv->hscrollbar_policy != GTK_POLICY_EXTERNAL;
-      vscrollbar_visible = priv->vscrollbar_policy != GTK_POLICY_NEVER &&
-                           priv->vscrollbar_policy != GTK_POLICY_EXTERNAL;
+      hscrollbar_visible = priv->hscrollbar_policy != ST_POLICY_NEVER &&
+                           priv->hscrollbar_policy != ST_POLICY_EXTERNAL;
+      vscrollbar_visible = priv->vscrollbar_policy != ST_POLICY_NEVER &&
+                           priv->vscrollbar_policy != ST_POLICY_EXTERNAL;
     }
 
   /* Whether or not we show the scrollbars, if the scrollbars are visible
@@ -661,12 +662,12 @@ st_scroll_view_allocate (ClutterActor          *actor,
    * Fold this into the scrollbar sizes to simplify the rest of the
    * computations.
    */
-  if (priv->hscrollbar_policy == GTK_POLICY_NEVER ||
-      priv->hscrollbar_policy == GTK_POLICY_EXTERNAL ||
+  if (priv->hscrollbar_policy == ST_POLICY_NEVER ||
+      priv->hscrollbar_policy == ST_POLICY_EXTERNAL ||
       priv->overlay_scrollbars)
     sb_height = 0;
-  if (priv->vscrollbar_policy == GTK_POLICY_NEVER ||
-      priv->vscrollbar_policy == GTK_POLICY_EXTERNAL ||
+  if (priv->vscrollbar_policy == ST_POLICY_NEVER ||
+      priv->vscrollbar_policy == ST_POLICY_EXTERNAL ||
       priv->overlay_scrollbars)
     sb_width = 0;
 
@@ -828,16 +829,16 @@ st_scroll_view_class_init (StScrollViewClass *klass)
   pspec = g_param_spec_enum ("vscrollbar-policy",
                              "Vertical Scrollbar Policy",
                              "When the vertical scrollbar is displayed",
-                             GTK_TYPE_POLICY_TYPE,
-                             GTK_POLICY_AUTOMATIC,
+                             ST_TYPE_POLICY_TYPE,
+                             ST_POLICY_AUTOMATIC,
                              G_PARAM_READWRITE);
   g_object_class_install_property (object_class, PROP_VSCROLLBAR_POLICY, pspec);
 
   pspec = g_param_spec_enum ("hscrollbar-policy",
                              "Horizontal Scrollbar Policy",
                              "When the horizontal scrollbar is displayed",
-                             GTK_TYPE_POLICY_TYPE,
-                             GTK_POLICY_AUTOMATIC,
+                             ST_TYPE_POLICY_TYPE,
+                             ST_POLICY_AUTOMATIC,
                              G_PARAM_READWRITE);
   g_object_class_install_property (object_class, PROP_HSCROLLBAR_POLICY, pspec);
 
@@ -879,8 +880,8 @@ st_scroll_view_init (StScrollView *self)
 {
   StScrollViewPrivate *priv = self->priv = st_scroll_view_get_instance_private (self);
 
-  priv->hscrollbar_policy = GTK_POLICY_AUTOMATIC;
-  priv->vscrollbar_policy = GTK_POLICY_AUTOMATIC;
+  priv->hscrollbar_policy = ST_POLICY_AUTOMATIC;
+  priv->vscrollbar_policy = ST_POLICY_AUTOMATIC;
 
   priv->hadjustment = g_object_new (ST_TYPE_ADJUSTMENT, NULL);
   priv->hscroll = g_object_new (ST_TYPE_SCROLL_BAR,
@@ -1187,8 +1188,8 @@ st_scroll_view_get_overlay_scrollbars (StScrollView *scroll)
  */
 void
 st_scroll_view_set_policy (StScrollView   *scroll,
-                           GtkPolicyType   hscroll,
-                           GtkPolicyType   vscroll)
+                           StPolicyType    hscroll,
+                           StPolicyType    vscroll)
 {
   StScrollViewPrivate *priv;
 
index 35a27a6529349414d664f075e1f3611576f9f7d3..2f2c31d6c925cd54d3176cde4075b2ca66712482 100644 (file)
@@ -34,6 +34,14 @@ G_BEGIN_DECLS
 #define ST_TYPE_SCROLL_VIEW            (st_scroll_view_get_type())
 G_DECLARE_FINAL_TYPE (StScrollView, st_scroll_view, ST, SCROLL_VIEW, StBin)
 
+typedef enum
+{
+  ST_POLICY_ALWAYS,
+  ST_POLICY_AUTOMATIC,
+  ST_POLICY_NEVER,
+  ST_POLICY_EXTERNAL,
+} StPolicyType;
+
 typedef struct _StScrollViewPrivate   StScrollViewPrivate;
 
 /**
@@ -72,8 +80,8 @@ void          st_scroll_view_set_overlay_scrollbars (StScrollView *scroll,
 gboolean      st_scroll_view_get_overlay_scrollbars (StScrollView *scroll);
 
 void          st_scroll_view_set_policy          (StScrollView   *scroll,
-                                                  GtkPolicyType   hscroll,
-                                                  GtkPolicyType   vscroll);
+                                                  StPolicyType    hscroll,
+                                                  StPolicyType    vscroll);
 void          st_scroll_view_update_fade_effect  (StScrollView *scroll,
                                                   float vfade_offset,
                                                   float hfade_offset);